home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
vbmail
/
vbmail.frm
< prev
next >
Wrap
Text File
|
1995-10-23
|
6KB
|
234 lines
VERSION 2.00
Begin Form vbmail
BackColor = &H00FFFF00&
Caption = "Mail Message Editor"
ClientHeight = 3555
ClientLeft = 960
ClientTop = 810
ClientWidth = 7650
Height = 4245
Icon = VBMAIL.FRX:0000
Left = 900
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3555
ScaleWidth = 7650
Top = 180
Width = 7770
Begin TextBox MsgText
Height = 1845
Left = 255
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Top = 1545
Width = 7200
End
Begin TextBox Subject
Height = 285
Left = 780
TabIndex = 1
Top = 1005
Width = 4395
End
Begin CommandButton ID_DISCARD
Caption = "Discard"
Height = 420
Left = 6720
TabIndex = 4
Top = 705
Width = 735
End
Begin CommandButton ID_SEND
Caption = "Send"
Height = 420
Left = 5790
TabIndex = 3
Top = 720
Width = 720
End
Begin TextBox Addressee
Height = 285
Left = 780
TabIndex = 0
Top = 660
Width = 3240
End
Begin PictureBox Picture2
BackColor = &H00FFFF00&
BorderStyle = 0 'None
Height = 495
Left = 6810
Picture = VBMAIL.FRX:0302
ScaleHeight = 495
ScaleWidth = 495
TabIndex = 7
Top = 135
Width = 495
End
Begin PictureBox Picture1
BackColor = &H00FFFF00&
BorderStyle = 0 'None
Height = 495
Left = 5940
Picture = VBMAIL.FRX:0604
ScaleHeight = 495
ScaleWidth = 495
TabIndex = 8
Top = 150
Width = 495
End
Begin Label Label3
BackColor = &H00FFFF00&
Caption = "Subj:"
Height = 300
Left = 195
TabIndex = 6
Top = 1035
Width = 510
End
Begin Label Label2
BackColor = &H00FFFF00&
Caption = "To:"
Height = 255
Left = 195
TabIndex = 5
Top = 720
Width = 375
End
Begin Label From
BackColor = &H00FFFF00&
Caption = "fffffffffffffffffffffffffffffffffffffffffffffffffffff"
Height = 285
Left = 795
TabIndex = 12
Top = 360
Width = 3225
End
Begin Label Label4
BackColor = &H00FFFF00&
Caption = "From:"
Height = 285
Left = 195
TabIndex = 11
Top = 345
Width = 510
End
Begin Label MsgDate
BackColor = &H00FFFF00&
Caption = "xx/xx/xx"
Height = 225
Left = 810
TabIndex = 10
Top = 75
Width = 840
End
Begin Label Label1
BackColor = &H00FFFF00&
Caption = "Date:"
Height = 255
Left = 210
TabIndex = 9
Top = 60
Width = 495
End
Begin Menu ID_FILE
Caption = "&File"
Begin Menu ID_OPEN
Caption = "&Open..."
End
Begin Menu menuspace
Caption = "-"
End
Begin Menu ID_EXIT
Caption = "E&xit"
End
End
End
Sub Form_Load ()
MsgText.Text = ""
Addressee.Text = ""
Subject.Text = ""
MsgDate.Caption = MakeDate(Date$)
From.Caption = MyUserName
End Sub
Sub Form_Unload (Cancel As Integer)
End
End Sub
Sub ID_DISCARD_Click ()
If MsgBox("Discard Message?", 4, "E-Mail") = 6 Then
Addressee.Text = ""
Subject.Text = ""
MsgText.Text = ""
Addressee.SetFocus
End If
End Sub
Sub ID_EXIT_Click ()
End
End Sub
Sub ID_OPEN_Click ()
LastWindow = 1
OpenWindow.Show
End Sub
Sub ID_SEND_Click ()
'
' Search For a match on user name
'
i = 0
Do While i < AddrBook.UserName.ListCount
User$ = RTrim$(Left$(AddrBook.UserName.List(i), 20))
If LCase$(User$) = LCase$(Addressee.Text) Then
Exit Do
End If
i = i + 1
Loop
If i = AddrBook.UserName.ListCount Then
'
' No match on user name, load the address book
'
LastWindow = 1
AddrBook.Show
Else
'
' matching user, build a file name
'
AddrUserId = Mid$(AddrBook.UserName.List(i), 21) + "\"
f = 1
Do
fn$ = AddrUserId + "EMAIL" + Right$("000" + LTrim$(Str$(f)), 3) + ".MSG"
If Dir$(fn$) = "" Then
Exit Do
End If
f = f + 1
Loop Until f = 1000
If f = 1000 Then
MsgBox Addressee.Text + "'s Mailbox is Full", 16, "Error"
Else
Open fn$ For Output Access Write As #1
Print #1, Date$
Print #1, MyUserId
Print #1, Subject.Text
Print #1, MsgText.Text
Close #1
MsgBox "Message Delivered", 0, "E-Mail"
Addressee.SetFocus
End If
End If
End Sub
Sub Label2_Click ()
Addressee.SetFocus
End Sub